Skip to content

Conversation

@stracker-phil
Copy link
Collaborator

@stracker-phil stracker-phil commented Sep 24, 2025

Description

Implements PHP schema classes for the PayPal Cart API v1, enabling type-safe parsing and validation of cart data for the Agentic Commerce integration.

These classes provide structured data objects matching PayPal's API specification. All incoming cart data from external AI agents will be parsed through these schemas before reaching business logic.

Core schemas: PayPalCart, PayPalCartResponse, ValidationIssue
Component schemas: CartItem, Customer, Address, GeoCoordinates, PaymentMethod, CheckoutField
Utility schemas: Money, AppliedCoupon, CartTotals, Coupon, ShippingOption, GiftOptions

Design Decisions

Forgiving parsers: Validate data format while preserving both valid and invalid data for downstream business validation. The to_array() method intentionally returns potentially invalid or incomplete input data

Immutable DTOs: All schemas are immutable value objects

@github-actions
Copy link

github-actions bot commented Sep 24, 2025

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

🔗 Test this pull request with WordPress Playground

What's included:

  • ✅ WordPress (latest)
  • ✅ WooCommerce (latest)
  • ✅ PayPal Payments plugin v3.1.2-pr3691-18677581030-gcc36495 (built from this PR)

Login credentials:

  • Username: admin
  • Password: password

Plugin Details:

  • Version: 3.1.2-pr3691-18677581030-gcc36495
  • Commit: cc36495
  • Artifact: woocommerce-paypal-payments-3.1.2-pr3691-18677581030-gcc36495

💡 The demo environment resets each time you refresh. Perfect for testing!

🔄 This link updates automatically with each new commit to the PR.

⚠️ This URL is valid for 30 days from when this comment was last updated.


🤖 Auto-generated for commit cc36495 • Last updated: 2025-10-21T08:52:39.610Z

@stracker-phil stracker-phil force-pushed the PCP-5267-create-schema-classes branch from 666ffe2 to 7fa2f19 Compare October 21, 2025 08:21
@stracker-phil stracker-phil merged commit cbd9fd2 into PCP-4891-agentic-commerce Oct 23, 2025
17 checks passed
@stracker-phil stracker-phil deleted the PCP-5267-create-schema-classes branch October 23, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants